// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 校验当前用户是否已登录 GET /checkLogin */
export async function checkLoginUsingGet(options?: { [key: string]: any }) {
  return request<API.Robject>('/checkLogin', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 获取当前登录用户ID(未登录抛出NotLoginException) GET /getLoginId */
export async function getLoginIdUsingGet(options?: { [key: string]: any }) {
  return request<API.Robject>('/getLoginId', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 获取指定token对应的登录id(未登录返回Null) GET /getLoginIdByToken/${param0} */
export async function getLoginIdByTokenUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getLoginIdByTokenUsingGETParams,
  options?: { [key: string]: any },
) {
  const { tokenValue: param0, ...queryParams } = params;
  return request<API.Robject>(`/getLoginIdByToken/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 获取当前登录用户id(未登录返回Null) GET /getLoginIdDefaultNull */
export async function getLoginIdDefaultNullUsingGet(options?: { [key: string]: any }) {
  return request<API.Robject>('/getLoginIdDefaultNull', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 获取当前Token信息 GET /getTokenInfo */
export async function getTokenInfoUsingGet(options?: { [key: string]: any }) {
  return request<API.Robject>('/getTokenInfo', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 获取当前Token的Name GET /getTokenName */
export async function getTokenNameUsingGet(options?: { [key: string]: any }) {
  return request<API.Robject>('/getTokenName', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 获取当前对话有效期 GET /getTokenTimeout */
export async function getTokenTimeoutUsingGet(options?: { [key: string]: any }) {
  return request<API.Robject>('/getTokenTimeout', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 确认是否登录 GET /isLogin */
export async function isLoginUsingGet(options?: { [key: string]: any }) {
  return request<API.Robject>('/isLogin', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 账号密码登录 POST /login */
export async function loginUsingPost(body: API.LoginReq, options?: { [key: string]: any }) {
  return request<API.Robject>('/login', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 注销登录 POST /logout */
export async function logoutUsingPost(options?: { [key: string]: any }) {
  return request<API.Robject>('/logout', {
    method: 'POST',
    ...(options || {}),
  });
}
